home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / PInterfaces / Sound.p < prev    next >
Encoding:
Text File  |  1997-08-12  |  53.6 KB  |  1,261 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        Sound.p
  3.  
  4.      Contains:    Sound Manager Interfaces.
  5.  
  6.      Version:    Technology:    Sound Manager 3.3
  7.                  Release:    Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1986-1997 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT Sound;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __SOUND__}
  28. {$SETC __SOUND__ := 1}
  29.  
  30. {$I+}
  31. {$SETC SoundIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __TYPES__}
  35. {$I Types.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __DIALOGS__}
  38. {$I Dialogs.p}
  39. {$ENDC}
  40. {$IFC UNDEFINED __COMPONENTS__}
  41. {$I Components.p}
  42. {$ENDC}
  43. {$IFC UNDEFINED __MIXEDMODE__}
  44. {$I MixedMode.p}
  45. {$ENDC}
  46. {$IFC UNDEFINED __MOVIES__}
  47. {$I Movies.p}
  48. {$ENDC}
  49.  
  50.  
  51. {$PUSH}
  52. {$ALIGN MAC68K}
  53. {$LibExport+}
  54.  
  55. {
  56.                         * * *  N O T E  * * *
  57.  
  58.     This file has been updated to include Sound Manager 3.3 interfaces.
  59.  
  60.     Some of the Sound Manager 3.0 interfaces were not put into the InterfaceLib
  61.     that originally shipped with the PowerMacs. These missing functions and the
  62.     new 3.3 interfaces have been released in the SoundLib library for PowerPC
  63.     developers to link with. The runtime library for these functions are
  64.     installed by the Sound Manager. The following functions are found in SoundLib.
  65.  
  66.         GetCompressionInfo(), GetSoundPreference(), SetSoundPreference(),
  67.         UnsignedFixedMulDiv(), SndGetInfo(), SndSetInfo(), GetSoundOutputInfo(),
  68.         SetSoundOutputInfo(), GetCompressionName(), SoundConverterOpen(),
  69.         SoundConverterClose(), SoundConverterGetBufferSizes(), SoundConverterBeginConversion(),
  70.         SoundConverterConvertBuffer(), SoundConverterEndConversion(),
  71.         AudioGetBass, AudioGetInfo, AudioGetMute, AudioGetOutputDevice,
  72.         AudioGetTreble, AudioGetVolume, AudioMuteOnEvent, AudioSetBass,
  73.         AudioSetMute, AudioSetToDefaults, AudioSetTreble, AudioSetVolume,
  74.         OpenMixerSoundComponent, CloseMixerSoundComponent, SoundComponentAddSource,
  75.         SoundComponentGetInfo, SoundComponentGetSource, SoundComponentGetSourceData,
  76.         SoundComponentInitOutputDevice, SoundComponentPauseSource,
  77.         SoundComponentPlaySourceBuffer, SoundComponentRemoveSource,
  78.         SoundComponentSetInfo, SoundComponentSetOutput, SoundComponentSetSource,
  79.         SoundComponentStartSource, SoundComponentStopSource
  80.         ParseAIFFHeader(), ParseSndHeader()
  81. }
  82. {
  83.     Interfaces for Sound Driver, !!! OBSOLETE and NOT SUPPORTED !!!
  84.  
  85.     These items are no longer defined, but appear here so that someone
  86.     searching the interfaces might find them. If you are using one of these
  87.     items, you must change your code to support the Sound Manager.
  88.  
  89.         swMode, ftMode, ffMode
  90.         FreeWave, FFSynthRec, Tone, SWSynthRec, Wave, FTSoundRec
  91.         SndCompletionProcPtr
  92.         StartSound, StopSound, SoundDone
  93. }
  94. {
  95.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  96.    constants
  97.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  98. }
  99. CONST twelfthRootTwo = 1.05946309435;
  100.  
  101.  
  102. CONST
  103.     soundListRsrc                = 'snd ';                        { Resource type used by Sound Manager }
  104.     rate48khz                    = $BB800000;                    { 48000.00000 in fixed-point }
  105.     rate44khz                    = $AC440000;                    { 44100.00000 in fixed-point }
  106.     rate22050hz                    = $56220000;                    { 22050.00000 in fixed-point }
  107.     rate22khz                    = $56EE8BA3;                    { 22254.54545 in fixed-point }
  108.     rate11khz                    = $2B7745D1;                    { 11127.27273 in fixed-point }
  109.     rate11025hz                    = $2B110000;                    { 11025.00000 in fixed-point }
  110.                                                                 { synthesizer numbers for SndNewChannel }
  111.     squareWaveSynth                = 1;                            { square wave synthesizer }
  112.     waveTableSynth                = 3;                            { wave table synthesizer }
  113.     sampledSynth                = 5;                            { sampled sound synthesizer }
  114.                                                                 { old Sound Manager MACE synthesizer numbers }
  115.     MACE3snthID                    = 11;
  116.     MACE6snthID                    = 13;
  117.     kMiddleC                    = 60;                            { MIDI note value for middle C }
  118.     kSimpleBeepID                = 1;                            { reserved resource ID for Simple Beep }
  119.     kFullVolume                    = $0100;                        { 1.0, setting for full hardware output volume }
  120.     kNoVolume                    = 0;                            { setting for no sound volume }
  121.     stdQLength                    = 128;
  122.     dataOffsetFlag                = $8000;
  123.     kUseOptionalOutputDevice    = -1;                            { only for Sound Manager 3.0 or later }
  124.     notCompressed                = 0;                            { compression ID's }
  125.     fixedCompression            = -1;                            { compression ID for fixed-sized compression }
  126.     variableCompression            = -2;                            { compression ID for variable-sized compression }
  127.     twoToOne                    = 1;
  128.     eightToThree                = 2;
  129.     threeToOne                    = 3;
  130.     sixToOne                    = 4;
  131.     sixToOnePacketSize            = 8;
  132.     threeToOnePacketSize        = 16;
  133.     stateBlockSize                = 64;
  134.     leftOverBlockSize            = 32;
  135.     firstSoundFormat            = $0001;                        { general sound format }
  136.     secondSoundFormat            = $0002;                        { special sampled sound format (HyperCard) }
  137.     dbBufferReady                = $00000001;                    { double buffer is filled }
  138.     dbLastBuffer                = $00000004;                    { last double buffer to play }
  139.     sysBeepDisable                = $0000;                        { SysBeep() enable flags }
  140.     sysBeepEnable                = $01;
  141.     sysBeepSynchronous            = $02;                            { if bit set, make alert sounds synchronous }
  142.     unitTypeNoSelection            = $FFFF;                        { unitTypes for AudioSelection.unitType }
  143.     unitTypeSeconds                = $0000;
  144.  
  145.     stdSH                        = $00;                            { Standard sound header encode value }
  146.     extSH                        = $FF;                            { Extended sound header encode value }
  147.     cmpSH                        = $FE;                            { Compressed sound header encode value }
  148.  
  149. {command numbers for SndDoCommand and SndDoImmediate}
  150.     nullCmd                        = 0;
  151.     initCmd                        = 1;
  152.     freeCmd                        = 2;
  153.     quietCmd                    = 3;
  154.     flushCmd                    = 4;
  155.     reInitCmd                    = 5;
  156.     waitCmd                        = 10;
  157.     pauseCmd                    = 11;
  158.     resumeCmd                    = 12;
  159.     callBackCmd                    = 13;
  160.     syncCmd                        = 14;
  161.     availableCmd                = 24;
  162.     versionCmd                    = 25;
  163.     totalLoadCmd                = 26;
  164.     loadCmd                        = 27;
  165.     freqDurationCmd                = 40;
  166.     restCmd                        = 41;
  167.     freqCmd                        = 42;
  168.     ampCmd                        = 43;
  169.     timbreCmd                    = 44;
  170.     getAmpCmd                    = 45;
  171.     volumeCmd                    = 46;                            { sound manager 3.0 or later only }
  172.     getVolumeCmd                = 47;                            { sound manager 3.0 or later only }
  173.     clockComponentCmd            = 50;                            { sound manager 3.2.1 or later only }
  174.     getClockComponentCmd        = 51;                            { sound manager 3.2.1 or later only }
  175.     waveTableCmd                = 60;
  176.     phaseCmd                    = 61;
  177.     soundCmd                    = 80;
  178.     bufferCmd                    = 81;
  179.     rateCmd                        = 82;
  180.     continueCmd                    = 83;
  181.     doubleBufferCmd                = 84;
  182.     getRateCmd                    = 85;
  183.     rateMultiplierCmd            = 86;
  184.     getRateMultiplierCmd        = 87;
  185.     sizeCmd                        = 90;                            { obsolete command }
  186.     convertCmd                    = 91;                            { obsolete MACE command }
  187.  
  188. {$IFC OLDROUTINENAMES }
  189. {channel initialization parameters}
  190.     waveInitChannelMask            = $07;
  191.     waveInitChannel0            = $04;                            { wave table only, Sound Manager 2.0 and earlier }
  192.     waveInitChannel1            = $05;                            { wave table only, Sound Manager 2.0 and earlier }
  193.     waveInitChannel2            = $06;                            { wave table only, Sound Manager 2.0 and earlier }
  194.     waveInitChannel3            = $07;                            { wave table only, Sound Manager 2.0 and earlier }
  195.     initChan0                    = $04;                            { obsolete spelling }
  196.     initChan1                    = $05;                            { obsolete spelling }
  197.     initChan2                    = $06;                            { obsolete spelling }
  198.     initChan3                    = $07;                            { obsolete spelling }
  199.  
  200.     outsideCmpSH                = 0;                            { obsolete MACE constant }
  201.     insideCmpSH                    = 1;                            { obsolete MACE constant }
  202.     aceSuccess                    = 0;                            { obsolete MACE constant }
  203.     aceMemFull                    = 1;                            { obsolete MACE constant }
  204.     aceNilBlock                    = 2;                            { obsolete MACE constant }
  205.     aceBadComp                    = 3;                            { obsolete MACE constant }
  206.     aceBadEncode                = 4;                            { obsolete MACE constant }
  207.     aceBadDest                    = 5;                            { obsolete MACE constant }
  208.     aceBadCmd                    = 6;                            { obsolete MACE constant }
  209.  
  210. {$ENDC}  {OLDROUTINENAMES}
  211.  
  212.     initChanLeft                = $0002;                        { left stereo channel }
  213.     initChanRight                = $0003;                        { right stereo channel }
  214.     initNoInterp                = $0004;                        { no linear interpolation }
  215.     initNoDrop                    = $0008;                        { no drop-sample conversion }
  216.     initMono                    = $0080;                        { monophonic channel }
  217.     initStereo                    = $00C0;                        { stereo channel }
  218.     initMACE3                    = $0300;                        { MACE 3:1 }
  219.     initMACE6                    = $0400;                        { MACE 6:1 }
  220.     initPanMask                    = $0003;                        { mask for right/left pan values }
  221.     initSRateMask                = $0030;                        { mask for sample rate values }
  222.     initStereoMask                = $00C0;                        { mask for mono/stereo values }
  223.     initCompMask                = $FF00;                        { mask for compression IDs }
  224.  
  225. {Get&Set Sound Information Selectors}
  226.     siActiveChannels            = 'chac';                        { active channels }
  227.     siActiveLevels                = 'lmac';                        { active meter levels }
  228.     siAGCOnOff                    = 'agc ';                        { automatic gain control state }
  229.     siAsync                        = 'asyn';                        { asynchronous capability }
  230.     siAVDisplayBehavior            = 'avdb';
  231.     siChannelAvailable            = 'chav';                        { number of channels available }
  232.     siCompressionAvailable        = 'cmav';                        { compression types available }
  233.     siCompressionFactor            = 'cmfa';                        { current compression factor }
  234.     siCompressionHeader            = 'cmhd';                        { return compression header }
  235.     siCompressionNames            = 'cnam';                        { compression type names available }
  236.     siCompressionParams            = 'cmpp';                        { compression parameters }
  237.     siCompressionType            = 'comp';                        { current compression type }
  238.     siContinuous                = 'cont';                        { continous recording }
  239.     siDeviceBufferInfo            = 'dbin';                        { size of interrupt buffer }
  240.     siDeviceConnected            = 'dcon';                        { input device connection status }
  241.     siDeviceIcon                = 'icon';                        { input device icon }
  242.     siDeviceName                = 'name';                        { input device name }
  243.     siHardwareBalance            = 'hbal';
  244.     siHardwareBalanceSteps        = 'hbls';
  245.     siHardwareBass                = 'hbas';
  246.     siHardwareBassSteps            = 'hbst';
  247.     siHardwareBusy                = 'hwbs';                        { sound hardware is in use }
  248.     siHardwareFormat            = 'hwfm';                        { get hardware format }
  249.     siHardwareMute                = 'hmut';                        { mute state of all hardware }
  250.     siHardwareTreble            = 'htrb';
  251.     siHardwareTrebleSteps        = 'hwts';
  252.     siHardwareVolume            = 'hvol';                        { volume level of all hardware }
  253.     siHardwareVolumeSteps        = 'hstp';                        { number of volume steps for hardware }
  254.     siHeadphoneMute                = 'pmut';                        { mute state of headphones }
  255.     siHeadphoneVolume            = 'pvol';                        { volume level of headphones }
  256.     siHeadphoneVolumeSteps        = 'hdst';                        { number of volume steps for headphones }
  257.     siInputAvailable            = 'inav';                        { input sources available }
  258.     siInputGain                    = 'gain';                        { input gain }
  259.     siInputSource                = 'sour';                        { input source selector }
  260.     siInputSourceNames            = 'snam';                        { input source names }
  261.     siLevelMeterOnOff            = 'lmet';                        { level meter state }
  262.     siModemGain                    = 'mgai';                        { modem input gain }
  263.     siMonitorAvailable            = 'mnav';
  264.     siMonitorSource                = 'mons';
  265.     siNumberChannels            = 'chan';                        { current number of channels }
  266.     siOptionsDialog                = 'optd';                        { display options dialog }
  267.     siPlayThruOnOff                = 'plth';                        { playthrough state }
  268.     siPostMixerSoundComponent    = 'psmx';                        { install post-mixer effect }
  269.     siPreMixerSoundComponent    = 'prmx';                        { install pre-mixer effect }
  270.     siQuality                    = 'qual';                        { quality setting }
  271.     siRateMultiplier            = 'rmul';                        { throttle rate setting }
  272.     siRecordingQuality            = 'qual';                        { recording quality }
  273.     siSampleRate                = 'srat';                        { current sample rate }
  274.     siSampleRateAvailable        = 'srav';                        { sample rates available }
  275.     siSampleSize                = 'ssiz';                        { current sample size }
  276.     siSampleSizeAvailable        = 'ssav';                        { sample sizes available }
  277.     siSetupCDAudio                = 'sucd';                        { setup sound hardware for CD audio }
  278.     siSetupModemAudio            = 'sumd';                        { setup sound hardware for modem audio }
  279.     siSlopeAndIntercept            = 'flap';                        { floating point variables for conversion }
  280.     siSoundClock                = 'sclk';
  281.     siSpeakerMute                = 'smut';                        { mute state of all built-in speaker }
  282.     siSpeakerVolume                = 'svol';                        { volume level of built-in speaker }
  283.     siSSpCPULoadLimit            = '3dll';
  284.     siSSpLocalization            = '3dif';
  285.     siSSpSpeakerSetup            = '3dst';
  286.     siStereoInputGain            = 'sgai';                        { stereo input gain }
  287.     siSubwooferMute                = 'bmut';                        { mute state of sub-woofer }
  288.     siTwosComplementOnOff        = 'twos';                        { two's complement state }
  289.     siVolume                    = 'volu';                        { volume level of source }
  290.     siVoxRecordInfo                = 'voxr';                        { VOX record parameters }
  291.     siVoxStopInfo                = 'voxs';                        { VOX stop parameters }
  292.     siWideStereo                = 'wide';                        { wide stereo setting }
  293.  
  294.     siCloseDriver                = 'clos';                        { reserved for internal use only }
  295.     siInitializeDriver            = 'init';                        { reserved for internal use only }
  296.     siPauseRecording            = 'paus';                        { reserved for internal use only }
  297.     siUserInterruptProc            = 'user';                        { reserved for internal use only }
  298.  
  299. { Sound Component Types and Subtypes }
  300.     kNoSoundComponentType        = '****';
  301.     kSoundComponentType            = 'sift';                        { component type }
  302.     kSoundComponentPPCType        = 'nift';                        { component type for PowerPC code }
  303.     kRate8SubType                = 'ratb';                        { 8-bit rate converter }
  304.     kRate16SubType                = 'ratw';                        { 16-bit rate converter }
  305.     kConverterSubType            = 'conv';                        { sample format converter }
  306.     kSndSourceSubType            = 'sour';                        { generic source component }
  307.     kMixerType                    = 'mixr';
  308.     kMixer8SubType                = 'mixb';                        { 8-bit mixer }
  309.     kMixer16SubType                = 'mixw';                        { 16-bit mixer }
  310.     kSoundOutputDeviceType        = 'sdev';                        { sound output component }
  311.     kClassicSubType                = 'clas';                        { classic hardware, i.e. Mac Plus }
  312.     kASCSubType                    = 'asc ';                        { Apple Sound Chip device }
  313.     kDSPSubType                    = 'dsp ';                        { DSP device }
  314.     kAwacsSubType                = 'awac';                        { Another of Will's Audio Chips device }
  315.     kGCAwacsSubType                = 'awgc';                        { Awacs audio with Grand Central DMA }
  316.     kSingerSubType                = 'sing';                        { Singer (via Whitney) based sound }
  317.     kSinger2SubType                = 'sng2';                        { Singer 2 (via Whitney) for Acme }
  318.     kWhitSubType                = 'whit';                        { Whit sound component for PrimeTime 3 }
  319.     kSoundBlasterSubType        = 'sbls';                        { Sound Blaster for CHRP }
  320.     kSoundCompressor            = 'scom';
  321.     kSoundDecompressor            = 'sdec';
  322.     kSoundEffectsType            = 'snfx';                        { sound effects type }
  323.     kSSpLocalizationSubType        = 'snd3';
  324.  
  325. { Format Types }
  326.     kSoundNotCompressed            = 'NONE';                        { sound is not compressed }
  327.     kOffsetBinary                = 'raw ';                        { offset binary }
  328.     kMACE3Compression            = 'MAC3';                        { MACE 3:1 }
  329.     kMACE6Compression            = 'MAC6';                        { MACE 6:1 }
  330.     kCDXA4Compression            = 'cdx4';                        { CD/XA 4:1 }
  331.     kCDXA2Compression            = 'cdx2';                        { CD/XA 2:1 }
  332.     kIMACompression                = 'ima4';                        { IMA 4:1 }
  333.     kULawCompression            = 'ulaw';                        { µLaw 2:1 }
  334.     kALawCompression            = 'alaw';                        { aLaw 2:1 }
  335.     kLittleEndianFormat            = 'sowt';                        { Little-endian }
  336.     kFloat32Format                = 'fl32';                        { 32-bit floating point }
  337.     kFloat64Format                = 'fl64';                        { 64-bit floating point }
  338.     kTwosComplement                = 'twos';                        { old name for compatibility }
  339.  
  340. { Features Flags }
  341.     k8BitRawIn                    = $01;                            { data description }
  342.     k8BitTwosIn                    = $02;
  343.     k16BitIn                    = $04;
  344.     kStereoIn                    = $08;
  345.     k8BitRawOut                    = $0100;
  346.     k8BitTwosOut                = $0200;
  347.     k16BitOut                    = $0400;
  348.     kStereoOut                    = $0800;
  349.     kReverse                    = $00010000;                    {   function description }
  350.     kRateConvert                = $00020000;
  351.     kCreateSoundSource            = $00040000;
  352.     kHighQuality                = $00400000;                    {   performance description }
  353.     kNonRealTime                = $00800000;
  354.  
  355. { SoundComponentPlaySourceBuffer action flags }
  356.     kSourcePaused                = $01;
  357.     kPassThrough                = $00010000;
  358.     kNoSoundComponentChain        = $00020000;
  359.  
  360. { SoundParamBlock flags, usefull for OpenMixerSoundComponent }
  361.     kNoMixing                    = $01;                            { don't mix source }
  362.     kNoSampleRateConversion        = $02;                            { don't convert sample rate (i.e. 11 kHz -> 22 kHz) }
  363.     kNoSampleSizeConversion        = $04;                            { don't convert sample size (i.e. 16 -> 8) }
  364.     kNoSampleFormatConversion    = $08;                            { don't convert sample format (i.e. 'twos' -> 'raw ') }
  365.     kNoChannelConversion        = $10;                            { don't convert stereo/mono }
  366.     kNoDecompression            = $20;                            { don't decompress (i.e. 'MAC3' -> 'raw ') }
  367.     kNoVolumeConversion            = $40;                            { don't apply volume }
  368.     kNoRealtimeProcessing        = $80;                            { won't run at interrupt time }
  369.     kScheduledSource            = $0100;                        { source is scheduled }
  370.  
  371. { SoundParamBlock quality settings }
  372.     kBestQuality                = $01;                            { use interpolation in rate conversion }
  373.  
  374. { useful bit masks }
  375.     kInputMask                    = $000000FF;                    { masks off input bits }
  376.     kOutputMask                    = $0000FF00;                    { masks off output bits }
  377.     kOutputShift                = 8;                            { amount output bits are shifted }
  378.     kActionMask                    = $00FF0000;                    { masks off action bits }
  379.     kSoundComponentBits            = $00FFFFFF;
  380.  
  381. { siAVDisplayBehavior types }
  382.     kAVDisplayHeadphoneRemove    = 0;                            {  monitor does not have a headphone attached }
  383.     kAVDisplayHeadphoneInsert    = 1;                            {  monitor has a headphone attached }
  384.     kAVDisplayPlainTalkRemove    = 2;                            {  monitor either sending no input through CPU input port or unable to tell if input is coming in }
  385.     kAVDisplayPlainTalkInsert    = 3;                            {  monitor sending PlainTalk level microphone source input through sound input port }
  386.  
  387. { Audio Component constants }
  388.                                                                 { Values for whichChannel parameter }
  389.     audioAllChannels            = 0;                            { All channels (usually interpreted as both left and right) }
  390.     audioLeftChannel            = 1;                            { Left channel }
  391.     audioRightChannel            = 2;                            { Right channel }
  392.                                                                 { Values for mute parameter }
  393.     audioUnmuted                = 0;                            { Device is unmuted }
  394.     audioMuted                    = 1;                            { Device is muted }
  395.                                                                 { Capabilities flags definitions }
  396.     audioDoesMono                = $00000001;                    { Device supports mono output }
  397.     audioDoesStereo                = $00000002;                    { Device supports stereo output }
  398.     audioDoesIndependentChannels = $00000004;                    { Device supports independent software control of each channel }
  399.  
  400. {Sound Input Qualities}
  401.     siCDQuality                    = 'cd  ';                        { 44.1kHz, stereo, 16 bit }
  402.     siBestQuality                = 'best';                        { 22kHz, mono, 8 bit }
  403.     siBetterQuality                = 'betr';                        { 22kHz, mono, MACE 3:1 }
  404.     siGoodQuality                = 'good';                        { 22kHz, mono, MACE 6:1 }
  405.  
  406.     siDeviceIsConnected            = 1;                            { input device is connected and ready for input }
  407.     siDeviceNotConnected        = 0;                            { input device is not connected }
  408.     siDontKnowIfConnected        = -1;                            { can't tell if input device is connected }
  409.     siReadPermission            = 0;                            { permission passed to SPBOpenDevice }
  410.     siWritePermission            = 1;                            { permission passed to SPBOpenDevice }
  411.  
  412. {
  413.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  414.    typedefs
  415.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  416. }
  417.  
  418.  
  419. TYPE
  420.     SndCommandPtr = ^SndCommand;
  421.     SndCommand = PACKED RECORD
  422.         cmd:                    INTEGER;
  423.         param1:                    INTEGER;
  424.         param2:                    LONGINT;
  425.     END;
  426.  
  427.     SndChannelPtr = ^SndChannel;
  428.     SndCallBackProcPtr = ProcPtr;  { PROCEDURE SndCallBack(chan: SndChannelPtr; VAR cmd: SndCommand); }
  429.  
  430.     SndCallBackUPP = UniversalProcPtr;
  431.     SndChannel = PACKED RECORD
  432.         nextChan:                SndChannelPtr;
  433.         firstMod:                Ptr;                                    {  reserved for the Sound Manager  }
  434.         callBack:                SndCallBackUPP;
  435.         userInfo:                LONGINT;
  436.         wait:                    LONGINT;                                {  The following is for internal Sound Manager use only. }
  437.         cmdInProgress:            SndCommand;
  438.         flags:                    INTEGER;
  439.         qLength:                INTEGER;
  440.         qHead:                    INTEGER;
  441.         qTail:                    INTEGER;
  442.         queue:                    ARRAY [0..127] OF SndCommand;
  443.     END;
  444.  
  445. {MACE structures}
  446.     StateBlockPtr = ^StateBlock;
  447.     StateBlock = RECORD
  448.         stateVar:                ARRAY [0..63] OF INTEGER;
  449.     END;
  450.  
  451.     LeftOverBlockPtr = ^LeftOverBlock;
  452.     LeftOverBlock = RECORD
  453.         count:                    LONGINT;
  454.         sampleArea:                ARRAY [0..31] OF SInt8;
  455.     END;
  456.  
  457.     ModRefPtr = ^ModRef;
  458.     ModRef = RECORD
  459.         modNumber:                INTEGER;
  460.         modInit:                LONGINT;
  461.     END;
  462.  
  463.     SndListResourcePtr = ^SndListResource;
  464.     SndListResource = RECORD
  465.         format:                    INTEGER;
  466.         numModifiers:            INTEGER;
  467.         modifierPart:            ARRAY [0..0] OF ModRef;
  468.         numCommands:            INTEGER;
  469.         commandPart:            ARRAY [0..0] OF SndCommand;
  470.         dataPart:                SInt8;
  471.     END;
  472.  
  473.     SndListPtr                            = ^SndListResource;
  474.     SndListHndl                            = ^SndListPtr;
  475.     SndListHandle                        = ^SndListPtr;
  476. {HyperCard sound resource format}
  477.     Snd2ListResourcePtr = ^Snd2ListResource;
  478.     Snd2ListResource = RECORD
  479.         format:                    INTEGER;
  480.         refCount:                INTEGER;
  481.         numCommands:            INTEGER;
  482.         commandPart:            ARRAY [0..0] OF SndCommand;
  483.         dataPart:                SInt8;
  484.     END;
  485.  
  486.     Snd2ListPtr                            = ^Snd2ListResource;
  487.     Snd2ListHndl                        = ^Snd2ListPtr;
  488.     Snd2ListHandle                        = ^Snd2ListPtr;
  489.     SoundHeaderPtr = ^SoundHeader;
  490.     SoundHeader = PACKED RECORD
  491.         samplePtr:                Ptr;                                    { if NIL then samples are in sampleArea }
  492.         length:                    LONGINT;                                { length of sound in bytes }
  493.         sampleRate:                UnsignedFixed;                            { sample rate for this sound }
  494.         loopStart:                LONGINT;                                { start of looping portion }
  495.         loopEnd:                LONGINT;                                { end of looping portion }
  496.         encode:                    UInt8;                                    { header encoding }
  497.         baseFrequency:            UInt8;                                    { baseFrequency value }
  498.         sampleArea:                PACKED ARRAY [0..0] OF UInt8;            { space for when samples follow directly }
  499.     END;
  500.  
  501.     CmpSoundHeaderPtr = ^CmpSoundHeader;
  502.     CmpSoundHeader = PACKED RECORD
  503.         samplePtr:                Ptr;                                    { if nil then samples are in sample area }
  504.         numChannels:            LONGINT;                                { number of channels i.e. mono = 1 }
  505.         sampleRate:                UnsignedFixed;                            { sample rate in Apples Fixed point representation }
  506.         loopStart:                LONGINT;                                { loopStart of sound before compression }
  507.         loopEnd:                LONGINT;                                { loopEnd of sound before compression }
  508.         encode:                    UInt8;                                    { data structure used , stdSH, extSH, or cmpSH }
  509.         baseFrequency:            UInt8;                                    { same meaning as regular SoundHeader }
  510.         numFrames:                LONGINT;                                { length in frames ( packetFrames or sampleFrames ) }
  511.         AIFFSampleRate:            extended80;                                { IEEE sample rate }
  512.         markerChunk:            Ptr;                                    { sync track }
  513.         format:                    OSType;                                    { data format type, was futureUse1 }
  514.         futureUse2:                LONGINT;                                { reserved by Apple }
  515.         stateVars:                StateBlockPtr;                            { pointer to State Block }
  516.         leftOverSamples:        LeftOverBlockPtr;                        { used to save truncated samples between compression calls }
  517.         compressionID:            INTEGER;                                { 0 means no compression, non zero means compressionID }
  518.         packetSize:                INTEGER;                                { number of bits in compressed sample packet }
  519.         snthID:                    INTEGER;                                { resource ID of Sound Manager snth that contains NRT C/E }
  520.         sampleSize:                INTEGER;                                { number of bits in non-compressed sample }
  521.         sampleArea:                PACKED ARRAY [0..0] OF UInt8;            { space for when samples follow directly }
  522.     END;
  523.  
  524.     ExtSoundHeaderPtr = ^ExtSoundHeader;
  525.     ExtSoundHeader = PACKED RECORD
  526.         samplePtr:                Ptr;                                    { if nil then samples are in sample area }
  527.         numChannels:            LONGINT;                                { number of channels,  ie mono = 1 }
  528.         sampleRate:                UnsignedFixed;                            { sample rate in Apples Fixed point representation }
  529.         loopStart:                LONGINT;                                { same meaning as regular SoundHeader }
  530.         loopEnd:                LONGINT;                                { same meaning as regular SoundHeader }
  531.         encode:                    UInt8;                                    { data structure used , stdSH, extSH, or cmpSH }
  532.         baseFrequency:            UInt8;                                    { same meaning as regular SoundHeader }
  533.         numFrames:                LONGINT;                                { length in total number of frames }
  534.         AIFFSampleRate:            extended80;                                { IEEE sample rate }
  535.         markerChunk:            Ptr;                                    { sync track }
  536.         instrumentChunks:        Ptr;                                    { AIFF instrument chunks }
  537.         AESRecording:            Ptr;
  538.         sampleSize:                INTEGER;                                { number of bits in sample }
  539.         futureUse1:                INTEGER;                                { reserved by Apple }
  540.         futureUse2:                LONGINT;                                { reserved by Apple }
  541.         futureUse3:                LONGINT;                                { reserved by Apple }
  542.         futureUse4:                LONGINT;                                { reserved by Apple }
  543.         sampleArea:                PACKED ARRAY [0..0] OF UInt8;            { space for when samples follow directly }
  544.     END;
  545.  
  546.     SoundHeaderUnionPtr = ^SoundHeaderUnion;
  547.     SoundHeaderUnion = RECORD
  548.         CASE INTEGER OF
  549.         0: (
  550.             stdHeader:            SoundHeader;
  551.             );
  552.         1: (
  553.             cmpHeader:            CmpSoundHeader;
  554.             );
  555.         2: (
  556.             extHeader:            ExtSoundHeader;
  557.             );
  558.     END;
  559.  
  560.     ConversionBlockPtr = ^ConversionBlock;
  561.     ConversionBlock = RECORD
  562.         destination:            INTEGER;
  563.         unused:                    INTEGER;
  564.         inputPtr:                CmpSoundHeaderPtr;
  565.         outputPtr:                CmpSoundHeaderPtr;
  566.     END;
  567.  
  568.     SMStatusPtr = ^SMStatus;
  569.     SMStatus = PACKED RECORD
  570.         smMaxCPULoad:            INTEGER;
  571.         smNumChannels:            INTEGER;
  572.         smCurCPULoad:            INTEGER;
  573.     END;
  574.  
  575.     SCStatusPtr = ^SCStatus;
  576.     SCStatus = RECORD
  577.         scStartTime:            UnsignedFixed;
  578.         scEndTime:                UnsignedFixed;
  579.         scCurrentTime:            UnsignedFixed;
  580.         scChannelBusy:            BOOLEAN;
  581.         scChannelDisposed:        BOOLEAN;
  582.         scChannelPaused:        BOOLEAN;
  583.         scUnused:                BOOLEAN;
  584.         scChannelAttributes:    LONGINT;
  585.         scCPULoad:                LONGINT;
  586.     END;
  587.  
  588.     AudioSelectionPtr = ^AudioSelection;
  589.     AudioSelection = PACKED RECORD
  590.         unitType:                LONGINT;
  591.         selStart:                UnsignedFixed;
  592.         selEnd:                    UnsignedFixed;
  593.     END;
  594.  
  595.     SndDoubleBufferPtr = ^SndDoubleBuffer;
  596.     SndDoubleBuffer = PACKED RECORD
  597.         dbNumFrames:            LONGINT;
  598.         dbFlags:                LONGINT;
  599.         dbUserInfo:                ARRAY [0..1] OF LONGINT;
  600.         dbSoundData:            ARRAY [0..0] OF SInt8;
  601.     END;
  602.  
  603.     SndDoubleBackProcPtr = ProcPtr;  { PROCEDURE SndDoubleBack(channel: SndChannelPtr; doubleBufferPtr: SndDoubleBufferPtr); }
  604.  
  605.     SndDoubleBackUPP = UniversalProcPtr;
  606.     SndDoubleBufferHeaderPtr = ^SndDoubleBufferHeader;
  607.     SndDoubleBufferHeader = PACKED RECORD
  608.         dbhNumChannels:            INTEGER;
  609.         dbhSampleSize:            INTEGER;
  610.         dbhCompressionID:        INTEGER;
  611.         dbhPacketSize:            INTEGER;
  612.         dbhSampleRate:            UnsignedFixed;
  613.         dbhBufferPtr:            ARRAY [0..1] OF SndDoubleBufferPtr;
  614.         dbhDoubleBack:            SndDoubleBackUPP;
  615.     END;
  616.  
  617.     SndDoubleBufferHeader2Ptr = ^SndDoubleBufferHeader2;
  618.     SndDoubleBufferHeader2 = PACKED RECORD
  619.         dbhNumChannels:            INTEGER;
  620.         dbhSampleSize:            INTEGER;
  621.         dbhCompressionID:        INTEGER;
  622.         dbhPacketSize:            INTEGER;
  623.         dbhSampleRate:            UnsignedFixed;
  624.         dbhBufferPtr:            ARRAY [0..1] OF SndDoubleBufferPtr;
  625.         dbhDoubleBack:            SndDoubleBackUPP;
  626.         dbhFormat:                OSType;
  627.     END;
  628.  
  629.     SoundInfoListPtr = ^SoundInfoList;
  630.     SoundInfoList = PACKED RECORD
  631.         count:                    INTEGER;
  632.         infoHandle:                Handle;
  633.     END;
  634.  
  635.     SoundComponentDataPtr = ^SoundComponentData;
  636.     SoundComponentData = RECORD
  637.         flags:                    LONGINT;
  638.         format:                    OSType;
  639.         numChannels:            INTEGER;
  640.         sampleSize:                INTEGER;
  641.         sampleRate:                UnsignedFixed;
  642.         sampleCount:            LONGINT;
  643.         buffer:                    Ptr;
  644.         reserved:                LONGINT;
  645.     END;
  646.  
  647.     SoundParamBlockPtr = ^SoundParamBlock;
  648.     SoundParamProcPtr = ProcPtr;  { FUNCTION SoundParam(VAR pb: SoundParamBlockPtr): BOOLEAN; }
  649.  
  650.     SoundParamUPP = UniversalProcPtr;
  651.     SoundParamBlock = RECORD
  652.         recordSize:                LONGINT;                                { size of this record in bytes }
  653.         desc:                    SoundComponentData;                        { description of sound buffer }
  654.         rateMultiplier:            UnsignedFixed;                            { rate multiplier to apply to sound }
  655.         leftVolume:                INTEGER;                                { volumes to apply to sound }
  656.         rightVolume:            INTEGER;
  657.         quality:                LONGINT;                                { quality to apply to sound }
  658.         filter:                    ComponentInstance;                        { filter to apply to sound }
  659.         moreRtn:                SoundParamUPP;                            { routine to call to get more data }
  660.         completionRtn:            SoundParamUPP;                            { routine to call when buffer is complete }
  661.         refCon:                    LONGINT;                                { user refcon }
  662.         result:                    INTEGER;                                { result }
  663.     END;
  664.  
  665.     CompressionInfoPtr = ^CompressionInfo;
  666.     CompressionInfo = RECORD
  667.         recordSize:                LONGINT;
  668.         format:                    OSType;
  669.         compressionID:            INTEGER;
  670.         samplesPerPacket:        INTEGER;
  671.         bytesPerPacket:            INTEGER;
  672.         bytesPerFrame:            INTEGER;
  673.         bytesPerSample:            INTEGER;
  674.         futureUse1:                INTEGER;
  675.     END;
  676.  
  677.     CompressionInfoHandle                = ^CompressionInfoPtr;
  678. { private thing to use as a reference to a Sound Converter }
  679.     SoundConverter = ^LONGINT;
  680. { private thing to use as a reference to a Sound Source }
  681.     SoundSource = ^LONGINT;
  682.     SoundSourcePtr                        = ^SoundSource;
  683.     SoundComponentLinkPtr = ^SoundComponentLink;
  684.     SoundComponentLink = RECORD
  685.         description:            ComponentDescription;                    { Describes the sound component }
  686.         mixerID:                SoundSource;                            { Reserved by Apple }
  687.         linkID:                    SoundSourcePtr;                            { Reserved by Apple }
  688.     END;
  689.  
  690.     AudioInfoPtr = ^AudioInfo;
  691.     AudioInfo = RECORD
  692.         capabilitiesFlags:        LONGINT;                                { Describes device capabilities }
  693.         reserved:                LONGINT;                                { Reserved by Apple }
  694.         numVolumeSteps:            INTEGER;                                { Number of significant increments between min and max volume }
  695.     END;
  696.  
  697.  
  698. {
  699.    These two routines for Get/SetSoundVol should no longer be used.
  700.    They were for old Apple Sound Chip machines, and do not support the DSP or PowerMacs.
  701.    Use Get/SetDefaultOutputVolume instead, if you must change the user's machine.
  702. }
  703.  
  704. {$IFC OLDROUTINENAMES AND TARGET_CPU_68K }
  705. PROCEDURE SetSoundVol(level: INTEGER);
  706.  
  707. PROCEDURE GetSoundVol(VAR level: INTEGER);
  708.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  709.     INLINE $205F, $4218, $10B8, $0260;
  710.     {$ENDC}
  711. {$ENDC}
  712.  
  713. {  Sound Input Structures }
  714.  
  715. TYPE
  716.     SPBPtr = ^SPB;
  717. {user procedures called by sound input routines}
  718.     SIInterruptProcPtr = Register68kProcPtr;  { PROCEDURE SIInterrupt(inParamPtr: SPBPtr; dataBuffer: Ptr; peakAmplitude: INTEGER; sampleSize: LONGINT); }
  719.  
  720.     FilePlayCompletionProcPtr = ProcPtr;  { PROCEDURE FilePlayCompletion(chan: SndChannelPtr); }
  721.  
  722.     SICompletionProcPtr = ProcPtr;  { PROCEDURE SICompletion(inParamPtr: SPBPtr); }
  723.  
  724.     SIInterruptUPP = UniversalProcPtr;
  725.     FilePlayCompletionUPP = UniversalProcPtr;
  726.     SICompletionUPP = UniversalProcPtr;
  727. {Sound Input Parameter Block}
  728.     SPB = RECORD
  729.         inRefNum:                LONGINT;                                { reference number of sound input device }
  730.         count:                    LONGINT;                                { number of bytes to record }
  731.         milliseconds:            LONGINT;                                { number of milliseconds to record }
  732.         bufferLength:            LONGINT;                                { length of buffer in bytes }
  733.         bufferPtr:                Ptr;                                    { buffer to store sound data in }
  734.         completionRoutine:        SICompletionUPP;                        { completion routine }
  735.         interruptRoutine:        SIInterruptUPP;                            { interrupt routine }
  736.         userLong:                LONGINT;                                { user-defined field }
  737.         error:                    OSErr;                                    { error }
  738.         unused1:                LONGINT;                                { reserved - must be zero }
  739.     END;
  740.  
  741. {
  742.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  743.    functions for sound components
  744.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  745. }
  746. { Sound Component Dispatch Selectors }
  747.  
  748. CONST
  749.     kSoundComponentInitOutputDeviceSelect = 1;                    { these calls cannot be delegated }
  750.     kSoundComponentSetSourceSelect = 2;
  751.     kSoundComponentGetSourceSelect = 3;
  752.     kSoundComponentGetSourceDataSelect = 4;
  753.     kSoundComponentSetOutputSelect = 5;
  754.     kDelegatedSoundComponentSelectors = $0100;                    { first selector that can be delegated up the chain }
  755.                                                                 { these calls can be delegated and have own range }
  756.     kSoundComponentAddSourceSelect = $0101;
  757.     kSoundComponentRemoveSourceSelect = $0102;
  758.     kSoundComponentGetInfoSelect = $0103;
  759.     kSoundComponentSetInfoSelect = $0104;
  760.     kSoundComponentStartSourceSelect = $0105;
  761.     kSoundComponentStopSourceSelect = $0106;
  762.     kSoundComponentPauseSourceSelect = $0107;
  763.     kSoundComponentPlaySourceBufferSelect = $0108;
  764.  
  765. { Audio Component selectors }
  766.     kAudioGetVolumeSelect        = 0;
  767.     kAudioSetVolumeSelect        = 1;
  768.     kAudioGetMuteSelect            = 2;
  769.     kAudioSetMuteSelect            = 3;
  770.     kAudioSetToDefaultsSelect    = 4;
  771.     kAudioGetInfoSelect            = 5;
  772.     kAudioGetBassSelect            = 6;
  773.     kAudioSetBassSelect            = 7;
  774.     kAudioGetTrebleSelect        = 8;
  775.     kAudioSetTrebleSelect        = 9;
  776.     kAudioGetOutputDeviceSelect    = 10;
  777.     kAudioMuteOnEventSelect        = 129;
  778.  
  779. {
  780.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  781.    prototypes
  782.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  783. }
  784.  
  785. { Sound Manager routines }
  786. PROCEDURE SysBeep(duration: INTEGER);
  787.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  788.     INLINE $A9C8;
  789.     {$ENDC}
  790. FUNCTION SndDoCommand(chan: SndChannelPtr; {CONST}VAR cmd: SndCommand; noWait: BOOLEAN): OSErr;
  791.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  792.     INLINE $A803;
  793.     {$ENDC}
  794. FUNCTION SndDoImmediate(chan: SndChannelPtr; {CONST}VAR cmd: SndCommand): OSErr;
  795.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  796.     INLINE $A804;
  797.     {$ENDC}
  798. FUNCTION SndNewChannel(VAR chan: SndChannelPtr; synth: INTEGER; init: LONGINT; userRoutine: SndCallBackUPP): OSErr;
  799.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  800.     INLINE $A807;
  801.     {$ENDC}
  802. FUNCTION SndDisposeChannel(chan: SndChannelPtr; quietNow: BOOLEAN): OSErr;
  803.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  804.     INLINE $A801;
  805.     {$ENDC}
  806. FUNCTION SndPlay(chan: SndChannelPtr; sndHandle: SndListHandle; async: BOOLEAN): OSErr;
  807.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  808.     INLINE $A805;
  809.     {$ENDC}
  810. {$IFC OLDROUTINENAMES }
  811. FUNCTION SndAddModifier(chan: SndChannelPtr; modifier: Ptr; id: INTEGER; init: LONGINT): OSErr;
  812.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  813.     INLINE $A802;
  814.     {$ENDC}
  815. {$ENDC}  {OLDROUTINENAMES}
  816.  
  817. FUNCTION SndControl(id: INTEGER; VAR cmd: SndCommand): OSErr;
  818.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  819.     INLINE $A806;
  820.     {$ENDC}
  821. { Sound Manager 2.0 and later, uses _SoundDispatch }
  822. FUNCTION SndSoundManagerVersion: NumVersion;
  823.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  824.     INLINE $203C, $000C, $0008, $A800;
  825.     {$ENDC}
  826. FUNCTION SndStartFilePlay(chan: SndChannelPtr; fRefNum: INTEGER; resNum: INTEGER; bufferSize: LONGINT; theBuffer: UNIV Ptr; theSelection: AudioSelectionPtr; theCompletion: FilePlayCompletionUPP; async: BOOLEAN): OSErr;
  827.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  828.     INLINE $203C, $0D00, $0008, $A800;
  829.     {$ENDC}
  830. FUNCTION SndPauseFilePlay(chan: SndChannelPtr): OSErr;
  831.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  832.     INLINE $203C, $0204, $0008, $A800;
  833.     {$ENDC}
  834. FUNCTION SndStopFilePlay(chan: SndChannelPtr; quietNow: BOOLEAN): OSErr;
  835.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  836.     INLINE $203C, $0308, $0008, $A800;
  837.     {$ENDC}
  838. FUNCTION SndChannelStatus(chan: SndChannelPtr; theLength: INTEGER; theStatus: SCStatusPtr): OSErr;
  839.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  840.     INLINE $203C, $0510, $0008, $A800;
  841.     {$ENDC}
  842. FUNCTION SndManagerStatus(theLength: INTEGER; theStatus: SMStatusPtr): OSErr;
  843.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  844.     INLINE $203C, $0314, $0008, $A800;
  845.     {$ENDC}
  846. PROCEDURE SndGetSysBeepState(VAR sysBeepState: INTEGER);
  847.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  848.     INLINE $203C, $0218, $0008, $A800;
  849.     {$ENDC}
  850. FUNCTION SndSetSysBeepState(sysBeepState: INTEGER): OSErr;
  851.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  852.     INLINE $203C, $011C, $0008, $A800;
  853.     {$ENDC}
  854. FUNCTION SndPlayDoubleBuffer(chan: SndChannelPtr; theParams: SndDoubleBufferHeaderPtr): OSErr;
  855.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  856.     INLINE $203C, $0420, $0008, $A800;
  857.     {$ENDC}
  858. { MACE compression routines }
  859. FUNCTION MACEVersion: NumVersion;
  860.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  861.     INLINE $203C, $0000, $0010, $A800;
  862.     {$ENDC}
  863. PROCEDURE Comp3to1(inBuffer: UNIV Ptr; outBuffer: UNIV Ptr; cnt: LONGINT; inState: StateBlockPtr; outState: StateBlockPtr; numChannels: LONGINT; whichChannel: LONGINT);
  864.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  865.     INLINE $203C, $0004, $0010, $A800;
  866.     {$ENDC}
  867. PROCEDURE Exp1to3(inBuffer: UNIV Ptr; outBuffer: UNIV Ptr; cnt: LONGINT; inState: StateBlockPtr; outState: StateBlockPtr; numChannels: LONGINT; whichChannel: LONGINT);
  868.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  869.     INLINE $203C, $0008, $0010, $A800;
  870.     {$ENDC}
  871. PROCEDURE Comp6to1(inBuffer: UNIV Ptr; outBuffer: UNIV Ptr; cnt: LONGINT; inState: StateBlockPtr; outState: StateBlockPtr; numChannels: LONGINT; whichChannel: LONGINT);
  872.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  873.     INLINE $203C, $000C, $0010, $A800;
  874.     {$ENDC}
  875. PROCEDURE Exp1to6(inBuffer: UNIV Ptr; outBuffer: UNIV Ptr; cnt: LONGINT; inState: StateBlockPtr; outState: StateBlockPtr; numChannels: LONGINT; whichChannel: LONGINT);
  876.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  877.     INLINE $203C, $0010, $0010, $A800;
  878.     {$ENDC}
  879. { Sound Manager 3.0 and later calls }
  880. FUNCTION GetSysBeepVolume(VAR level: LONGINT): OSErr;
  881.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  882.     INLINE $203C, $0224, $0018, $A800;
  883.     {$ENDC}
  884. FUNCTION SetSysBeepVolume(level: LONGINT): OSErr;
  885.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  886.     INLINE $203C, $0228, $0018, $A800;
  887.     {$ENDC}
  888. FUNCTION GetDefaultOutputVolume(VAR level: LONGINT): OSErr;
  889.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  890.     INLINE $203C, $022C, $0018, $A800;
  891.     {$ENDC}
  892. FUNCTION SetDefaultOutputVolume(level: LONGINT): OSErr;
  893.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  894.     INLINE $203C, $0230, $0018, $A800;
  895.     {$ENDC}
  896. FUNCTION GetSoundHeaderOffset(sndHandle: SndListHandle; VAR offset: LONGINT): OSErr;
  897.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  898.     INLINE $203C, $0404, $0018, $A800;
  899.     {$ENDC}
  900. FUNCTION UnsignedFixedMulDiv(value: UnsignedFixed; multiplier: UnsignedFixed; divisor: UnsignedFixed): UnsignedFixed;
  901.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  902.     INLINE $203C, $060C, $0018, $A800;
  903.     {$ENDC}
  904. FUNCTION GetCompressionInfo(compressionID: INTEGER; format: OSType; numChannels: INTEGER; sampleSize: INTEGER; cp: CompressionInfoPtr): OSErr;
  905.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  906.     INLINE $203C, $0710, $0018, $A800;
  907.     {$ENDC}
  908. FUNCTION SetSoundPreference(theType: OSType; VAR name: Str255; settings: Handle): OSErr;
  909.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  910.     INLINE $203C, $0634, $0018, $A800;
  911.     {$ENDC}
  912. FUNCTION GetSoundPreference(theType: OSType; VAR name: Str255; settings: Handle): OSErr;
  913.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  914.     INLINE $203C, $0638, $0018, $A800;
  915.     {$ENDC}
  916. FUNCTION OpenMixerSoundComponent(outputDescription: SoundComponentDataPtr; outputFlags: LONGINT; VAR mixerComponent: ComponentInstance): OSErr;
  917.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  918.     INLINE $203C, $0614, $0018, $A800;
  919.     {$ENDC}
  920. FUNCTION CloseMixerSoundComponent(ci: ComponentInstance): OSErr;
  921.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  922.     INLINE $203C, $0218, $0018, $A800;
  923.     {$ENDC}
  924. { Sound Manager 3.1 and later calls }
  925. FUNCTION SndGetInfo(chan: SndChannelPtr; selector: OSType; infoPtr: UNIV Ptr): OSErr;
  926.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  927.     INLINE $203C, $063C, $0018, $A800;
  928.     {$ENDC}
  929. FUNCTION SndSetInfo(chan: SndChannelPtr; selector: OSType; infoPtr: UNIV Ptr): OSErr;
  930.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  931.     INLINE $203C, $0640, $0018, $A800;
  932.     {$ENDC}
  933. FUNCTION GetSoundOutputInfo(outputDevice: Component; selector: OSType; infoPtr: UNIV Ptr): OSErr;
  934.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  935.     INLINE $203C, $0644, $0018, $A800;
  936.     {$ENDC}
  937. FUNCTION SetSoundOutputInfo(outputDevice: Component; selector: OSType; infoPtr: UNIV Ptr): OSErr;
  938.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  939.     INLINE $203C, $0648, $0018, $A800;
  940.     {$ENDC}
  941. { Sound Manager 3.2 and later calls }
  942. FUNCTION GetCompressionName(compressionType: OSType; VAR compressionName: Str255): OSErr;
  943.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  944.     INLINE $203C, $044C, $0018, $A800;
  945.     {$ENDC}
  946. FUNCTION SoundConverterOpen({CONST}VAR inputFormat: SoundComponentData; {CONST}VAR outputFormat: SoundComponentData; VAR sc: SoundConverter): OSErr;
  947.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  948.     INLINE $203C, $0650, $0018, $A800;
  949.     {$ENDC}
  950. FUNCTION SoundConverterClose(sc: SoundConverter): OSErr;
  951.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  952.     INLINE $203C, $0254, $0018, $A800;
  953.     {$ENDC}
  954. FUNCTION SoundConverterGetBufferSizes(sc: SoundConverter; inputBytesTarget: LONGINT; VAR inputFrames: LONGINT; VAR inputBytes: LONGINT; VAR outputBytes: LONGINT): OSErr;
  955.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  956.     INLINE $203C, $0A58, $0018, $A800;
  957.     {$ENDC}
  958. FUNCTION SoundConverterBeginConversion(sc: SoundConverter): OSErr;
  959.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  960.     INLINE $203C, $025C, $0018, $A800;
  961.     {$ENDC}
  962. FUNCTION SoundConverterConvertBuffer(sc: SoundConverter; inputPtr: UNIV Ptr; inputFrames: LONGINT; outputPtr: UNIV Ptr; VAR outputFrames: LONGINT; VAR outputBytes: LONGINT): OSErr;
  963.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  964.     INLINE $203C, $0C60, $0018, $A800;
  965.     {$ENDC}
  966. FUNCTION SoundConverterEndConversion(sc: SoundConverter; outputPtr: UNIV Ptr; VAR outputFrames: LONGINT; VAR outputBytes: LONGINT): OSErr;
  967.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  968.     INLINE $203C, $0864, $0018, $A800;
  969.     {$ENDC}
  970. {
  971.   Sound Component Functions
  972.    basic sound component functions
  973. }
  974. FUNCTION SoundComponentInitOutputDevice(ti: ComponentInstance; actions: LONGINT): ComponentResult;
  975.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  976.     INLINE $2F3C, $0004, $0001, $7000, $A82A;
  977.     {$ENDC}
  978. FUNCTION SoundComponentSetSource(ti: ComponentInstance; sourceID: SoundSource; source: ComponentInstance): ComponentResult;
  979.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  980.     INLINE $2F3C, $0008, $0002, $7000, $A82A;
  981.     {$ENDC}
  982. FUNCTION SoundComponentGetSource(ti: ComponentInstance; sourceID: SoundSource; VAR source: ComponentInstance): ComponentResult;
  983.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  984.     INLINE $2F3C, $0008, $0003, $7000, $A82A;
  985.     {$ENDC}
  986. FUNCTION SoundComponentGetSourceData(ti: ComponentInstance; VAR sourceData: SoundComponentDataPtr): ComponentResult;
  987.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  988.     INLINE $2F3C, $0004, $0004, $7000, $A82A;
  989.     {$ENDC}
  990. FUNCTION SoundComponentSetOutput(ti: ComponentInstance; requested: SoundComponentDataPtr; VAR actual: SoundComponentDataPtr): ComponentResult;
  991.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  992.     INLINE $2F3C, $0008, $0005, $7000, $A82A;
  993.     {$ENDC}
  994. {  junction methods for the mixer, must be called at non-interrupt level }
  995. FUNCTION SoundComponentAddSource(ti: ComponentInstance; VAR sourceID: SoundSource): ComponentResult;
  996.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  997.     INLINE $2F3C, $0004, $0101, $7000, $A82A;
  998.     {$ENDC}
  999. FUNCTION SoundComponentRemoveSource(ti: ComponentInstance; sourceID: SoundSource): ComponentResult;
  1000.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1001.     INLINE $2F3C, $0004, $0102, $7000, $A82A;
  1002.     {$ENDC}
  1003. {  info methods }
  1004. FUNCTION SoundComponentGetInfo(ti: ComponentInstance; sourceID: SoundSource; selector: OSType; infoPtr: UNIV Ptr): ComponentResult;
  1005.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1006.     INLINE $2F3C, $000C, $0103, $7000, $A82A;
  1007.     {$ENDC}
  1008. FUNCTION SoundComponentSetInfo(ti: ComponentInstance; sourceID: SoundSource; selector: OSType; infoPtr: UNIV Ptr): ComponentResult;
  1009.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1010.     INLINE $2F3C, $000C, $0104, $7000, $A82A;
  1011.     {$ENDC}
  1012. {  control methods }
  1013. FUNCTION SoundComponentStartSource(ti: ComponentInstance; count: INTEGER; VAR sources: SoundSource): ComponentResult;
  1014.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1015.     INLINE $2F3C, $0006, $0105, $7000, $A82A;
  1016.     {$ENDC}
  1017. FUNCTION SoundComponentStopSource(ti: ComponentInstance; count: INTEGER; VAR sources: SoundSource): ComponentResult;
  1018.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1019.     INLINE $2F3C, $0006, $0106, $7000, $A82A;
  1020.     {$ENDC}
  1021. FUNCTION SoundComponentPauseSource(ti: ComponentInstance; count: INTEGER; VAR sources: SoundSource): ComponentResult;
  1022.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1023.     INLINE $2F3C, $0006, $0107, $7000, $A82A;
  1024.     {$ENDC}
  1025. FUNCTION SoundComponentPlaySourceBuffer(ti: ComponentInstance; sourceID: SoundSource; pb: SoundParamBlockPtr; actions: LONGINT): ComponentResult;
  1026.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1027.     INLINE $2F3C, $000C, $0108, $7000, $A82A;
  1028.     {$ENDC}
  1029. { Audio Components }
  1030. {Volume is described as a value between 0 and 1, with 0 indicating minimum
  1031.   volume and 1 indicating maximum volume; if the device doesn't support
  1032.   software control of volume, then a value of unimpErr is returned, indicating
  1033.   that these functions are not supported by the device}
  1034. FUNCTION AudioGetVolume(ac: ComponentInstance; whichChannel: INTEGER; VAR volume: ShortFixed): ComponentResult;
  1035.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1036.     INLINE $2F3C, $0006, $0000, $7000, $A82A;
  1037.     {$ENDC}
  1038. FUNCTION AudioSetVolume(ac: ComponentInstance; whichChannel: INTEGER; volume: ShortFixed): ComponentResult;
  1039.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1040.     INLINE $2F3C, $0004, $0001, $7000, $A82A;
  1041.     {$ENDC}
  1042. {If the device doesn't support software control of mute, then a value of unimpErr is
  1043. returned, indicating that these functions are not supported by the device.}
  1044. FUNCTION AudioGetMute(ac: ComponentInstance; whichChannel: INTEGER; VAR mute: INTEGER): ComponentResult;
  1045.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1046.     INLINE $2F3C, $0006, $0002, $7000, $A82A;
  1047.     {$ENDC}
  1048. FUNCTION AudioSetMute(ac: ComponentInstance; whichChannel: INTEGER; mute: INTEGER): ComponentResult;
  1049.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1050.     INLINE $2F3C, $0004, $0003, $7000, $A82A;
  1051.     {$ENDC}
  1052. {AudioSetToDefaults causes the associated device to reset its volume and mute values
  1053. (and perhaps other characteristics, e.g. attenuation) to "factory default" settings}
  1054. FUNCTION AudioSetToDefaults(ac: ComponentInstance): ComponentResult;
  1055.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1056.     INLINE $2F3C, $0000, $0004, $7000, $A82A;
  1057.     {$ENDC}
  1058. { This routine is required; it must be implemented by all audio components }
  1059.  
  1060. FUNCTION AudioGetInfo(ac: ComponentInstance; info: AudioInfoPtr): ComponentResult;
  1061.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1062.     INLINE $2F3C, $0004, $0005, $7000, $A82A;
  1063.     {$ENDC}
  1064. FUNCTION AudioGetBass(ac: ComponentInstance; whichChannel: INTEGER; VAR bass: INTEGER): ComponentResult;
  1065.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1066.     INLINE $2F3C, $0006, $0006, $7000, $A82A;
  1067.     {$ENDC}
  1068. FUNCTION AudioSetBass(ac: ComponentInstance; whichChannel: INTEGER; bass: INTEGER): ComponentResult;
  1069.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1070.     INLINE $2F3C, $0004, $0007, $7000, $A82A;
  1071.     {$ENDC}
  1072. FUNCTION AudioGetTreble(ac: ComponentInstance; whichChannel: INTEGER; VAR Treble: INTEGER): ComponentResult;
  1073.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1074.     INLINE $2F3C, $0006, $0008, $7000, $A82A;
  1075.     {$ENDC}
  1076. FUNCTION AudioSetTreble(ac: ComponentInstance; whichChannel: INTEGER; Treble: INTEGER): ComponentResult;
  1077.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1078.     INLINE $2F3C, $0004, $0009, $7000, $A82A;
  1079.     {$ENDC}
  1080. FUNCTION AudioGetOutputDevice(ac: ComponentInstance; VAR outputDevice: Component): ComponentResult;
  1081.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1082.     INLINE $2F3C, $0004, $000A, $7000, $A82A;
  1083.     {$ENDC}
  1084.  
  1085.  
  1086. { This is routine is private to the AudioVision component.  It enables the watching of the mute key. }
  1087. FUNCTION AudioMuteOnEvent(ac: ComponentInstance; muteOnEvent: INTEGER): ComponentResult;
  1088.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1089.     INLINE $2F3C, $0002, $0081, $7000, $A82A;
  1090.     {$ENDC}
  1091. { Sound Input Manager routines }
  1092. FUNCTION SPBVersion: NumVersion;
  1093.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1094.     INLINE $203C, $0000, $0014, $A800;
  1095.     {$ENDC}
  1096. FUNCTION SndRecord(filterProc: ModalFilterUPP; corner: Point; quality: OSType; VAR sndHandle: SndListHandle): OSErr;
  1097.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1098.     INLINE $203C, $0804, $0014, $A800;
  1099.     {$ENDC}
  1100. FUNCTION SndRecordToFile(filterProc: ModalFilterUPP; corner: Point; quality: OSType; fRefNum: INTEGER): OSErr;
  1101.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1102.     INLINE $203C, $0708, $0014, $A800;
  1103.     {$ENDC}
  1104. FUNCTION SPBSignInDevice(deviceRefNum: INTEGER; deviceName: ConstStr255Param): OSErr;
  1105.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1106.     INLINE $203C, $030C, $0014, $A800;
  1107.     {$ENDC}
  1108. FUNCTION SPBSignOutDevice(deviceRefNum: INTEGER): OSErr;
  1109.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1110.     INLINE $203C, $0110, $0014, $A800;
  1111.     {$ENDC}
  1112. FUNCTION SPBGetIndexedDevice(count: INTEGER; VAR deviceName: Str255; VAR deviceIconHandle: Handle): OSErr;
  1113.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1114.     INLINE $203C, $0514, $0014, $A800;
  1115.     {$ENDC}
  1116. FUNCTION SPBOpenDevice(deviceName: ConstStr255Param; permission: INTEGER; VAR inRefNum: LONGINT): OSErr;
  1117.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1118.     INLINE $203C, $0518, $0014, $A800;
  1119.     {$ENDC}
  1120. FUNCTION SPBCloseDevice(inRefNum: LONGINT): OSErr;
  1121.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1122.     INLINE $203C, $021C, $0014, $A800;
  1123.     {$ENDC}
  1124. FUNCTION SPBRecord(inParamPtr: SPBPtr; asynchFlag: BOOLEAN): OSErr;
  1125.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1126.     INLINE $203C, $0320, $0014, $A800;
  1127.     {$ENDC}
  1128. FUNCTION SPBRecordToFile(fRefNum: INTEGER; inParamPtr: SPBPtr; asynchFlag: BOOLEAN): OSErr;
  1129.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1130.     INLINE $203C, $0424, $0014, $A800;
  1131.     {$ENDC}
  1132. FUNCTION SPBPauseRecording(inRefNum: LONGINT): OSErr;
  1133.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1134.     INLINE $203C, $0228, $0014, $A800;
  1135.     {$ENDC}
  1136. FUNCTION SPBResumeRecording(inRefNum: LONGINT): OSErr;
  1137.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1138.     INLINE $203C, $022C, $0014, $A800;
  1139.     {$ENDC}
  1140. FUNCTION SPBStopRecording(inRefNum: LONGINT): OSErr;
  1141.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1142.     INLINE $203C, $0230, $0014, $A800;
  1143.     {$ENDC}
  1144. FUNCTION SPBGetRecordingStatus(inRefNum: LONGINT; VAR recordingStatus: INTEGER; VAR meterLevel: INTEGER; VAR totalSamplesToRecord: LONGINT; VAR numberOfSamplesRecorded: LONGINT; VAR totalMsecsToRecord: LONGINT; VAR numberOfMsecsRecorded: LONGINT): OSErr;
  1145.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1146.     INLINE $203C, $0E34, $0014, $A800;
  1147.     {$ENDC}
  1148. FUNCTION SPBGetDeviceInfo(inRefNum: LONGINT; infoType: OSType; infoData: UNIV Ptr): OSErr;
  1149.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1150.     INLINE $203C, $0638, $0014, $A800;
  1151.     {$ENDC}
  1152. FUNCTION SPBSetDeviceInfo(inRefNum: LONGINT; infoType: OSType; infoData: UNIV Ptr): OSErr;
  1153.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1154.     INLINE $203C, $063C, $0014, $A800;
  1155.     {$ENDC}
  1156. FUNCTION SPBMillisecondsToBytes(inRefNum: LONGINT; VAR milliseconds: LONGINT): OSErr;
  1157.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1158.     INLINE $203C, $0440, $0014, $A800;
  1159.     {$ENDC}
  1160. FUNCTION SPBBytesToMilliseconds(inRefNum: LONGINT; VAR byteCount: LONGINT): OSErr;
  1161.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1162.     INLINE $203C, $0444, $0014, $A800;
  1163.     {$ENDC}
  1164. FUNCTION SetupSndHeader(sndHandle: SndListHandle; numChannels: INTEGER; sampleRate: UnsignedFixed; sampleSize: INTEGER; compressionType: OSType; baseNote: INTEGER; numBytes: LONGINT; VAR headerLen: INTEGER): OSErr;
  1165.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1166.     INLINE $203C, $0D48, $0014, $A800;
  1167.     {$ENDC}
  1168. FUNCTION SetupAIFFHeader(fRefNum: INTEGER; numChannels: INTEGER; sampleRate: UnsignedFixed; sampleSize: INTEGER; compressionType: OSType; numBytes: LONGINT; numFrames: LONGINT): OSErr;
  1169.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1170.     INLINE $203C, $0B4C, $0014, $A800;
  1171.     {$ENDC}
  1172. { Sound Input Manager 1.1 and later calls }
  1173. FUNCTION ParseAIFFHeader(fRefNum: INTEGER; VAR sndInfo: SoundComponentData; VAR numFrames: LONGINT; VAR dataOffset: LONGINT): OSErr;
  1174.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1175.     INLINE $203C, $0758, $0014, $A800;
  1176.     {$ENDC}
  1177. FUNCTION ParseSndHeader(sndHandle: SndListHandle; VAR sndInfo: SoundComponentData; VAR numFrames: LONGINT; VAR dataOffset: LONGINT): OSErr;
  1178.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1179.     INLINE $203C, $085C, $0014, $A800;
  1180.     {$ENDC}
  1181.  
  1182. CONST
  1183.     uppSndCallBackProcInfo = $000003C0;
  1184.     uppSndDoubleBackProcInfo = $000003C0;
  1185.     uppSoundParamProcInfo = $000000D0;
  1186.     uppSIInterruptProcInfo = $1C579802;
  1187.     uppFilePlayCompletionProcInfo = $000000C0;
  1188.     uppSICompletionProcInfo = $000000C0;
  1189.  
  1190. FUNCTION NewSndCallBackProc(userRoutine: SndCallBackProcPtr): SndCallBackUPP;
  1191.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1192.     INLINE $2E9F;
  1193.     {$ENDC}
  1194.  
  1195. FUNCTION NewSndDoubleBackProc(userRoutine: SndDoubleBackProcPtr): SndDoubleBackUPP;
  1196.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1197.     INLINE $2E9F;
  1198.     {$ENDC}
  1199.  
  1200. FUNCTION NewSoundParamProc(userRoutine: SoundParamProcPtr): SoundParamUPP;
  1201.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1202.     INLINE $2E9F;
  1203.     {$ENDC}
  1204.  
  1205. FUNCTION NewSIInterruptProc(userRoutine: SIInterruptProcPtr): SIInterruptUPP;
  1206.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1207.     INLINE $2E9F;
  1208.     {$ENDC}
  1209.  
  1210. FUNCTION NewFilePlayCompletionProc(userRoutine: FilePlayCompletionProcPtr): FilePlayCompletionUPP;
  1211.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1212.     INLINE $2E9F;
  1213.     {$ENDC}
  1214.  
  1215. FUNCTION NewSICompletionProc(userRoutine: SICompletionProcPtr): SICompletionUPP;
  1216.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1217.     INLINE $2E9F;
  1218.     {$ENDC}
  1219.  
  1220. PROCEDURE CallSndCallBackProc(chan: SndChannelPtr; VAR cmd: SndCommand; userRoutine: SndCallBackUPP);
  1221.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1222.     INLINE $205F, $4E90;
  1223.     {$ENDC}
  1224.  
  1225. PROCEDURE CallSndDoubleBackProc(channel: SndChannelPtr; doubleBufferPtr: SndDoubleBufferPtr; userRoutine: SndDoubleBackUPP);
  1226.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1227.     INLINE $205F, $4E90;
  1228.     {$ENDC}
  1229.  
  1230. FUNCTION CallSoundParamProc(VAR pb: SoundParamBlockPtr; userRoutine: SoundParamUPP): BOOLEAN;
  1231.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1232.     INLINE $205F, $4E90;
  1233.     {$ENDC}
  1234.  
  1235. PROCEDURE CallSIInterruptProc(inParamPtr: SPBPtr; dataBuffer: Ptr; peakAmplitude: INTEGER; sampleSize: LONGINT; userRoutine: SIInterruptUPP);
  1236.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1237.     {To be implemented:  Glue to move parameters into registers.}
  1238.     {$ENDC}
  1239.  
  1240. PROCEDURE CallFilePlayCompletionProc(chan: SndChannelPtr; userRoutine: FilePlayCompletionUPP);
  1241.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1242.     INLINE $205F, $4E90;
  1243.     {$ENDC}
  1244.  
  1245. PROCEDURE CallSICompletionProc(inParamPtr: SPBPtr; userRoutine: SICompletionUPP);
  1246.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1247.     INLINE $205F, $4E90;
  1248.     {$ENDC}
  1249.  
  1250.  
  1251. {$ALIGN RESET}
  1252. {$POP}
  1253.  
  1254. {$SETC UsingIncludes := SoundIncludes}
  1255.  
  1256. {$ENDC} {__SOUND__}
  1257.  
  1258. {$IFC NOT UsingIncludes}
  1259.  END.
  1260. {$ENDC}
  1261.